//
//  MKSubpageTableViewCell.m
//  ManKeCartoon
//
//  Created by dllo on 15/10/21.
//  Copyright © 2015年 ManKe. All rights reserved.
//

#import "MKSubpageTableViewCell.h"
#import "MKBaseHeader.h"
#import "MKSubpageCollectionViewCell.h"
@implementation MKSubpageTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {

        UICollectionViewFlowLayout *flowLayout = [UICollectionViewFlowLayout alloc];
        
        flowLayout.itemSize = CGSizeMake(SCREEN_WIDTH/3, 200*HEIGHT);
        flowLayout.minimumInteritemSpacing = 0 ;
        flowLayout.minimumLineSpacing = 0 ;
        flowLayout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
        
        self.subpageCollectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 200*HEIGHT) collectionViewLayout:flowLayout];
        
        [self.contentView addSubview:self.subpageCollectionView];
        
        //注册
        [self.subpageCollectionView registerClass:[MKSubpageCollectionViewCell class] forCellWithReuseIdentifier:@"MKSubpageCollectionViewCell"];
        
        
        
    }
    return self;
}

-(void)setDelegat:(id<UICollectionViewDelegate>)delegat
{
    [self.subpageCollectionView setDelegate:delegat];
}
-(void)setDatasource:(id<UICollectionViewDataSource>)datasource
{
    [self.subpageCollectionView setDataSource:datasource];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
